package com.codinghero.zqlb.match;

import java.util.Comparator;



public class SoccerMatchComparator implements Comparator<SoccerMatch> {

	private SoccerMatchHotComparator hotComparator = new SoccerMatchHotComparator();
	private DateSortableComparator dateComparator = new DateSortableComparator();
	
	@Override
	public int compare(SoccerMatch o1, SoccerMatch o2) {
		int result = hotComparator.compare(o1, o2);
		if (result != 0)
			return result;
		
		result = dateComparator.compare(o1, o2);
		if (result != 0)
			return result;
		
		return o1.getId() - o2.getId();
	}

}
